package com.app.model;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;

/**
 * 订单表
 *
 * @author 16693103420
 * @since 2024-01-31
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("tb_order")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class OrderModel implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
//    @ExcelProperty(value = "订单表ID")
    private Integer id;//订单表ID
//    @ExcelProperty(value = "商家名称")
    private String businessName;//商家名称
//    @ExcelProperty(value = "益联券价值")
    private Double voucher;//益联券价值
//    @ExcelProperty(value = "活动封面图")
    private String activityCover;//活动封面图
//    @ExcelProperty(value = "活动名称")
    private String activityName;//活动名称
//    @ExcelProperty(value = "订单状态码")
    private Integer status;//订单状态 订单状态1 待使用2待评价 3已完成 4已取消
//    @ExcelProperty("用户ID")
    private Integer userId;//用户ID
//    @ExcelProperty("商家ID")
    private Integer businessId;//商家ID
//    @ExcelProperty("活动ID")
    private Integer activityId;//活动ID
//    @ExcelProperty("单号")
    private String orderId;//订单ID
//    @ExcelProperty(value = "核销码")
    private String verificationCode;//核销码
//    @ExcelProperty(value = "取消原因")
    private Integer orderReason;//取消原因
    @TableField(exist = false)
//    @ExcelProperty(value = "订单状态")
    private String statusName;//订单状态名称  订单状态1 待使用2待评价 3已完成 4已取消
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //后端注解格式化日期
//    @ExcelProperty("时间")
    private Timestamp createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //后端注解格式化日期
//    @ExcelProperty("更新时间")
    private Timestamp updateTime;
    @TableField(exist = false)
    private UserModel userModel;
    @TableField(exist = false)
    private String orderReasonText;
    private String areaId;
    private String cityId;
    @TableField(exist = false)
    private String areaText;
    @TableField(exist = false)
    private String area;
    @TableField(exist = false)
    private String city;
    @TableField(exist = false)
    private String province;
    @TableField(exist = false)
    private UserModel user;

    @TableField(exist = false)
    private Integer classification;
}
